package java_class_work.week06.serializable;

import java.io.Serializable;

/**
 * @Auther: admin
 * @Date: 2022/10/18 10:14
 * @Description: 实体类Person
 */

public class Person implements Serializable {
    //根据 ID 进行 反序列化，ID不同反序列化将会失败
    private static final long serialVersionUID = 1003732606018098495L;
    private String name;
    private int age;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
